{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "lesbian-springer",
   "metadata": {},
   "source": [
    "## Pipeline Readiness Check and Metdata Calls\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f91799c2",
   "metadata": {},
   "source": [
    "Local example settings."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "901ec6a6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "env: INFER_REST_ENDPOINT=http://0.0.0.0:9000\n",
      "env: INFER_GRPC_ENDPOINT=0.0.0.0:9000\n",
      "env: SELDON_SCHEDULE_HOST=0.0.0.0:9004\n"
     ]
    }
   ],
   "source": [
    "%env INFER_REST_ENDPOINT=http://0.0.0.0:9000\n",
    "%env INFER_GRPC_ENDPOINT=0.0.0.0:9000\n",
    "%env SELDON_SCHEDULE_HOST=0.0.0.0:9004"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ac2a9783",
   "metadata": {},
   "source": [
    "Remote k8s cluster example settings - change as neeed for your needs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "925ec380",
   "metadata": {},
   "outputs": [],
   "source": [
    "#%env INFER_REST_ENDPOINT=http://172.19.255.1:80\n",
    "#%env INFER_GRPC_ENDPOINT=172.19.255.1:80\n",
    "#%env SELDON_SCHEDULE_HOST=172.19.255.2:9004"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "running-antarctica",
   "metadata": {},
   "source": [
    "### Model Chain - Ready Check\n",
    "\n",
    "We will check the readiness of the Pipeline after every change to model and pipeline."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "7b2adc80",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "apiVersion: mlops.seldon.io/v1alpha1\r\n",
      "kind: Pipeline\r\n",
      "metadata:\r\n",
      "  name: tfsimples\r\n",
      "spec:\r\n",
      "  steps:\r\n",
      "    - name: tfsimple1\r\n",
      "    - name: tfsimple2\r\n",
      "      inputs:\r\n",
      "      - tfsimple1\r\n",
      "      tensorMap:\r\n",
      "        tfsimple1.outputs.OUTPUT0: INPUT0\r\n",
      "        tfsimple1.outputs.OUTPUT1: INPUT1\r\n",
      "  output:\r\n",
      "    steps:\r\n",
      "    - tfsimple2\r\n"
     ]
    }
   ],
   "source": [
    "!cat ./pipelines/tfsimples.yaml"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "9c7fdd82",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 404 Not Found\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:12 GMT\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "61ea0374",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ERROR:\r\n",
      "  Code: Unimplemented\r\n",
      "  Message: \r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "5b9c616e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"pipelineName\":\"tfsimples\", \"versions\":[{\"pipeline\":{\"name\":\"tfsimples\", \"uid\":\"ciepit2i8ufs73flaitg\", \"version\":1, \"steps\":[{\"name\":\"tfsimple1\"}, {\"name\":\"tfsimple2\", \"inputs\":[\"tfsimple1.outputs\"], \"tensorMap\":{\"tfsimple1.outputs.OUTPUT0\":\"INPUT0\", \"tfsimple1.outputs.OUTPUT1\":\"INPUT1\"}}], \"output\":{\"steps\":[\"tfsimple2.outputs\"]}, \"kubernetesMeta\":{}}, \"state\":{\"pipelineVersion\":1, \"status\":\"PipelineReady\", \"reason\":\"created pipeline\", \"lastChangeTimestamp\":\"2023-06-29T14:47:16.365934922Z\"}}]}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline load -f ./pipelines/tfsimples.yaml\n",
    "!seldon pipeline status tfsimples -w PipelineReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "79e5f931",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1;30mnull\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status tfsimples | jq .versions[0].state.modelsReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "9e1907d4",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 424 Failed Dependency\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:21 GMT\r",
      "\r\n",
      "\u001b[1mx-envoy-upstream-service-time\u001b[0m: 1\r",
      "\r\n",
      "\u001b[1mx-seldon-route\u001b[0m: :tfsimples.pipeline:\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "bb0064af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "f9e073d7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\n",
      "{}\n"
     ]
    }
   ],
   "source": [
    "!seldon model load -f ./models/tfsimple1.yaml \n",
    "!seldon model status tfsimple1 -w ModelAvailable "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e7112952",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 424 Failed Dependency\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:31 GMT\r",
      "\r\n",
      "\u001b[1mx-envoy-upstream-service-time\u001b[0m: 2\r",
      "\r\n",
      "\u001b[1mx-seldon-route\u001b[0m: :tfsimples.pipeline:\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "7488bec5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "997b4028",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{}\n",
      "{}\n"
     ]
    }
   ],
   "source": [
    "!seldon model load -f ./models/tfsimple2.yaml \n",
    "!seldon model status tfsimple2 -w ModelAvailable | jq -M ."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "45f2f89c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 200 OK\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:36 GMT\r",
      "\r\n",
      "\u001b[1mx-envoy-upstream-service-time\u001b[0m: 1\r",
      "\r\n",
      "\u001b[1mx-seldon-route\u001b[0m: :tfsimples.pipeline:\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "8258b96c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"ready\": true\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c92d0438",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0;39mtrue\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status tfsimples | jq .versions[0].state.modelsReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "dimensional-hours",
   "metadata": {},
   "outputs": [],
   "source": [
    "!seldon pipeline unload tfsimples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "a9076e85",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 404 Not Found\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:43 GMT\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "1174f2da",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ERROR:\r\n",
      "  Code: Unimplemented\r\n",
      "  Message: \r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ba57c305",
   "metadata": {},
   "source": [
    "Models will still be ready even though Pipeline terminated"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "607b9eb9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0;39mtrue\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status tfsimples | jq .versions[0].state.modelsReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "da02fcd8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"pipelineName\":\"tfsimples\", \"versions\":[{\"pipeline\":{\"name\":\"tfsimples\", \"uid\":\"ciepj5qi8ufs73flaiu0\", \"version\":1, \"steps\":[{\"name\":\"tfsimple1\"}, {\"name\":\"tfsimple2\", \"inputs\":[\"tfsimple1.outputs\"], \"tensorMap\":{\"tfsimple1.outputs.OUTPUT0\":\"INPUT0\", \"tfsimple1.outputs.OUTPUT1\":\"INPUT1\"}}], \"output\":{\"steps\":[\"tfsimple2.outputs\"]}, \"kubernetesMeta\":{}}, \"state\":{\"pipelineVersion\":1, \"status\":\"PipelineReady\", \"reason\":\"created pipeline\", \"lastChangeTimestamp\":\"2023-06-29T14:47:51.626155116Z\", \"modelsReady\":true}}]}\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline load -f ./pipelines/tfsimples.yaml\n",
    "!seldon pipeline status tfsimples -w PipelineReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "f6075200",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "HTTP/1.1 200 OK\r",
      "\r\n",
      "\u001b[1mdate\u001b[0m: Thu, 29 Jun 2023 14:47:53 GMT\r",
      "\r\n",
      "\u001b[1mx-envoy-upstream-service-time\u001b[0m: 2\r",
      "\r\n",
      "\u001b[1mx-seldon-route\u001b[0m: :tfsimples.pipeline:\r",
      "\r\n",
      "\u001b[1mserver\u001b[0m: envoy\r",
      "\r\n",
      "\u001b[1mtransfer-encoding\u001b[0m: chunked\r",
      "\r\n",
      "\r",
      "\r\n"
     ]
    }
   ],
   "source": [
    "!curl -Ik ${INFER_REST_ENDPOINT}/v2/pipelines/tfsimples/ready"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "082aa69b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\r\n",
      "  \"ready\": true\r\n",
      "}\r\n"
     ]
    }
   ],
   "source": [
    "!grpcurl -d '{\"name\":\"tfsimples\"}' \\\n",
    "    -plaintext \\\n",
    "    -import-path ../apis \\\n",
    "    -proto ../apis/mlops/v2_dataplane/v2_dataplane.proto \\\n",
    "    -rpc-header seldon-model:tfsimples.pipeline \\\n",
    "    ${INFER_GRPC_ENDPOINT} inference.GRPCInferenceService/ModelReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "4cdc413a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0;39mtrue\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status tfsimples | jq .versions[0].state.modelsReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "outside-inspiration",
   "metadata": {},
   "outputs": [],
   "source": [
    "!seldon model unload tfsimple1\n",
    "!seldon model unload tfsimple2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "6b7b199b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[1;30mnull\u001b[0m\r\n"
     ]
    }
   ],
   "source": [
    "!seldon pipeline status tfsimples | jq .versions[0].state.modelsReady"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "e017099a",
   "metadata": {},
   "outputs": [],
   "source": [
    "!seldon pipeline unload tfsimples"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3d0ef494",
   "metadata": {},
   "source": [
    "### Kubernetes Resource Example"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4cd1ddca",
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"NAMESPACE\"] = \"seldon-mesh\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "cd4514c8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'172.19.255.1'"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "MESH_IP=!kubectl get svc seldon-mesh -n ${NAMESPACE} -o jsonpath='{.status.loadBalancer.ingress[0].ip}'\n",
    "MESH_IP=MESH_IP[0]\n",
    "import os\n",
    "os.environ['MESH_IP'] = MESH_IP\n",
    "MESH_IP"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "f0bae6ff",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "pipeline.mlops.seldon.io/tfsimples created\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./pipelines/tfsimples.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "956500af",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "error: timed out waiting for the condition on pipelines/tfsimples\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=1s pipeline --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "aa7ef10e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"lastTransitionTime\":\"2022-11-14T10:25:31Z\",\"status\":\"False\",\"type\":\"ModelsReady\"}"
     ]
    }
   ],
   "source": [
    "!kubectl get pipeline tfsimples -o jsonpath='{.status.conditions[0]}' -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d9fc608b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io/tfsimple1 created\n",
      "model.mlops.seldon.io/tfsimple2 created\n"
     ]
    }
   ],
   "source": [
    "!kubectl create -f ./models/tfsimple1.yaml -n ${NAMESPACE}\n",
    "!kubectl create -f ./models/tfsimple2.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e9bc1be2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "pipeline.mlops.seldon.io/tfsimples condition met\r\n"
     ]
    }
   ],
   "source": [
    "!kubectl wait --for condition=ready --timeout=300s pipeline --all -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "757cda1f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"lastTransitionTime\":\"2022-11-14T10:25:49Z\",\"status\":\"True\",\"type\":\"ModelsReady\"}"
     ]
    }
   ],
   "source": [
    "!kubectl get pipeline tfsimples -o jsonpath='{.status.conditions[0]}' -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "2c1fb9fb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "model.mlops.seldon.io \"tfsimple1\" deleted\n",
      "model.mlops.seldon.io \"tfsimple2\" deleted\n",
      "pipeline.mlops.seldon.io \"tfsimples\" deleted\n"
     ]
    }
   ],
   "source": [
    "!kubectl delete -f ./models/tfsimple1.yaml -n ${NAMESPACE}\n",
    "!kubectl delete -f ./models/tfsimple2.yaml -n ${NAMESPACE}\n",
    "!kubectl delete -f ./pipelines/tfsimples.yaml -n ${NAMESPACE}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d9e700fe",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
